<template>
   <!-- 导航区 -->
    <div class="navigate">
      <RouterLink to="/home" active-class="active">首页</RouterLink>
      <RouterLink to="/news" active-class="active">新闻</RouterLink>
      <RouterLink to="/about" active-class="active">关于</RouterLink>
    </div>
    <!-- 展示区 -->
    <div class="main-content">
      <RouterView></RouterView>
    </div>
</template>


<script lang="ts">
   export default {
       name: 'HelloWorld',
   }
</script>


<script setup lang="ts">
import {RouterLink,RouterView} from 'vue-router'

</script>

<style scoped>
.layout-container {
  display: flex;
  height: 100vh; /* 占满整个视口高度 */
}

/* 左侧导航区域 */
.navigate {
  width: 200px; /* 固定宽度 */
  background-color: #333;
  color: white;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.navigate a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

.navigate a:hover {
  background-color: #555;
}

.navigate a.active {
  background-color: #42b983;
  font-weight: bold;
  color: #fff;
}

/* 右侧内容区域 */
.main-content {
  flex: 1; /* 自动撑满剩余空间 */
  padding: 20px;
  background-color: #a4b8d9;
  overflow-y: auto; /* 内容多时可滚动 */
}
</style>